<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/common/taglib.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'add.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
       ${msg }
  <form  action="${contextPath }/user/add" method="post">
  <table>
  <input type="hidden" name="tUser.id" value="${user.id }"/>
  <tr><td>
       姓名：<input type="text" name="tUser.name" value="${user.name }"> </input>
   </td></tr><tr><td>
       密码: <input type="password" name="tUser.pwd"  value="${user.pwd }"></input>
    </td></tr><tr><td>
       电话：<input type="text" name="tUser.tel"  value="${user.tel }"></input>
     </td></tr><tr><td>
       角色: <select id="roleId" name="tUser.roleId">
       <option value="-1">请选择</option>
        <c:forEach items="${roleList }" var="r">
         <option value="${r.roleid }" <c:if test="${r.roleid == user.roleID}">selected="selected"</c:if>>${r.roleName }</option>
        </c:forEach>
       </select>
     </td></tr>
     <tr><td>
         <input type="submit" value="保存"></input></td></tr>
         </table>
   </form>   
  </body>
</html>
